ActiveButtonWidget

constructor(title: Text, width: Int, height: Int, background: TextureSet?, activeSupplier: Supplier<Boolean>, pressAction: Consumer<ActiveButtonWidget>)

A Button Widget that can supply its message and active state, and render a custom background

Author

fzzyhmstrs

Since

0.6.0

Parameters

title

Text - The message/label for this button

width

Int - width of the widget

height

Int - height of the widget

activeSupplier

Supplier - Supplies whether this button is active or not

pressAction

Consumer - action to take when the button is pressed

background

TextureSet, Nullable - a custom background texture set; defaults to DEFAULT_TEXTURES if null is passed (default)


constructor(title: Text, width: Int, height: Int, activeSupplier: Supplier<Boolean>, pressAction: Consumer<ActiveButtonWidget>, background: Identifier? = null)

A Button Widget that can supply its message and active state, and render a custom background

Author

fzzyhmstrs

Since

0.2.0, demoted to tertiary constructor 0.6.0 for TextureSet constructors

Parameters

title

Text - The message/label for this button

width

Int - width of the widget

height

Int - height of the widget

activeSupplier

Supplier - Supplies whether this button is active or not

pressAction

Consumer - action to take when the button is pressed

background

Identifier, Nullable - a custom background texture which will be used for all rendering circumstances; defaults to the "normal" texture for DEFAULT_TEXTURES if null is passed (default)


constructor(titleSupplier: Supplier<Text>, width: Int, height: Int, activeSupplier: Supplier<Boolean>, pressAction: Consumer<ActiveButtonWidget>, textures: TextureSet = DEFAULT_TEXTURES)

Parameters

titleSupplier

Supplier<Text> - supplies the message/label for this button

width

Int - width of the widget

height

Int - height of the widget

activeSupplier

Supplier - Supplies whether this button is active or not

pressAction

Consumer - action to take when the button is pressed

textures

TextureSet, optional - a custom background texture set; defaults to DEFAULT_TEXTURES